unit ContaDM;

{$mode objfpc}{$H+}

interface

uses
 Classes, SysUtils, DB, FileUtil, LResources, Forms, Controls, Graphics,
  Dialogs, ZDataset, ZSqlUpdate, ZSequence, MainDM, QueryConditions;

type

  { TContaData }

    TContaData = class(TMainDataModule)
    ContaDatasource: TDatasource;
    ContaZQueryabre_caixa: TStringField;
    ContaZQuerycomputador: TStringField;
    ContaZQuerydesc_conta: TStringField;
    ContaZQueryid_conta: TLargeintField;
    ContaZQuerynota: TStringField;
    ContaZQuerynumero_agencia: TStringField;
    ContaZQuerynumero_banco: TStringField;
    ContaZQuerynumero_conta: TStringField;
    ContaZQuerysaldo: TFloatField;
    ContaZQuerystatus: TStringField;
    ContaZSequence: TZSequence;
    ContaZUpdate: TZUpdateSQL;
    ContaZQuery: TZQuery;
    procedure DataModuleCreate(Sender: TObject);
    /// Abre o DataSet
    procedure OpenDataSet(); override;
    /// Fecha o DataSet
    procedure CloseDataSet(); override;
    /// Realiza busca
    /// @param(Condicoes são as condições para a busca)
    /// @param(Tabela é a tabela no banco de dados)
    procedure Search(Condicoes: TQueryConditions; Tabela: string); override;
  end;

var
  ContaData: TContaData;

implementation

uses ConnectionDM;

{ TContaData }


procedure TContaData.DataModuleCreate(Sender: TObject);
begin
   MainDataSet := ContaZQuery;
   ContaZQuery.Open();
end;


procedure TContaData.OpenDataSet;
begin
  //ConnectionData.EmptyQuery(ContaZQuery, 'conta');
end;

procedure TContaData.CloseDataSet;
begin
  //ContaZQuery.Close();
end;

procedure TContaData.Search(Condicoes: TQueryConditions; Tabela: string);
begin
    ConnectionData.OpenQueryConditions(ContaZQuery, Tabela, Condicoes);
end;

initialization
  {$I contadm.lrs}

end.

